home *** CD-ROM | disk | FTP | other *** search
/ MIDICraft's MIDINET CD-ROM / MIDICraft's MIDINET CD-ROM.iso / DOSUTILS / MIDINOTE.DOC < prev    next >
Text File  |  1997-04-21  |  8KB  |  210 lines

  1.         ******************************
  2.             MIDINOTE v2.0
  3.     
  4.         midi binaries to sorted notes
  5.               by Guenter Nagler 
  6.                 1997 
  7.           (gnagler@ihm.tu-graz.ac.at)
  8.         ******************************
  9.  
  10. [1] BACKGROUND
  11. Midi file format is not easy to read because there are different formats,
  12. many commands, variable length data, parallel tracks and separate note on
  13. and note off commands that make it difficult to find note matches.
  14.  
  15. For programs that only want to analyze notes I wrote this converter
  16. that exports note information into a simple text table where notes are
  17. already sorted by time and contain most important parameters:
  18.   - start and length in midi units and milliseconds
  19.   - track (1-track count)
  20.   - channel (1-16)
  21.   - note value (0-127,   where C4 middle C is 60  and A4 is 440Hz)
  22.   - velocity  (0-127)
  23.  
  24. It shows also some other midi events that might be necessary for note processing:
  25.   * header information (units/beat, track count, version)
  26.   * tempo information (beats/min)
  27.   * tact information (bar beats/tact)
  28.  
  29. This simplier form of midi notes can be used in a variety of applications:
  30. score drawing, music and painting, lerning process of automatic composing,
  31. comparing music pieces, music pattern matching.
  32.  
  33. [2] FILES DESCRIPTION
  34.  
  35. MIDINOTE.EXE.........converter program
  36. MIDINOTE.DOC.........this file, showing usage of MIDINOTE.EXE
  37. MIDIIO.HPP..........header file for a c++ midi parser
  38. MIDIIO.CPP..........source code for a c++ midi parser
  39. MIDINOTE.CPP.........c++ source code for midi to note listing
  40. MIDINOTE.MAK.........make file for project 
  41. MIDINOTE.CFG.........compiler options for make
  42. MIDINOTE.PRJ.........project for borland c++ compilers
  43. only MIDINOTE.EXE is required to run program
  44.  
  45. [3] COPYRIGHT
  46.  
  47. MIDINOTE (c) 1997 was created by Guenter Nagler.
  48.  
  49. MIDINOTE is free and may be used as you wish with this one exception:
  50.  
  51.     You may NOT charge any fee or derive any profit for distribution
  52.     of MIDINOTE.  Thus, you may NOT sell or bundle MIDINOTE with any 
  53.     product in a retail environment (shareware disk distribution, CD-ROM,
  54.     etc.) without permission of the author.
  55.  
  56. You may give MIDINOTE to your friends, upload it to a BBS, or ftp it to
  57. another internet site, as long as you don't charge anything for it.
  58.  
  59. [4] DISCLAIMER
  60.  
  61. MIDINOTE was designed to handle 100% compatible standard midi files.
  62. So I give no guarantees of the results, especially with non 100% 
  63. compatible midi files.
  64. If you find a midi file that you think to be 100% compatible midi
  65. that is not correctly converted, please send a sample file to 
  66. gnagler@ihm.tu-graz.ac.at . 
  67.  
  68. Use MIDINOTE at your own risk.  Anything you do with MIDINOTE is your
  69. responsibility, and not the author's.  Any damage caused to any person,
  70. computer, software, hardware, company, or business by running MIDINOTE 
  71. is your responsibility, and the author will not be liable.
  72.  
  73. If you don't understand these terms, or are not sure of something, or
  74. are afraid something bad might come of using MIDINOTE, don't  use  it!
  75. You are here forewarned.
  76.  
  77. [5] INSTALLATION 
  78.  
  79. [MSDOS]
  80.  
  81.   Simply copy MIDINOTE.EXE in a directory that is in your path.
  82.   When you start the program without arguments
  83.  
  84.   C:\> MIDINOTE
  85.  
  86.   you should get the usage text (see next section)
  87.  
  88. [UNIX]
  89. compile sources with your C++ compiler (e.g. GNU Compiler g++):
  90.  
  91. g++ -o midinote midinote.cpp midiio.cpp 
  92.  
  93. and run program
  94.  
  95. $ midinote
  96.  
  97. [6] USAGE
  98.  
  99. usage: midinote [-noheader] [-values] input.mid [output.txt]
  100. -noheader    don't print header that explains the columns
  101. -values        print cryptical values for easier import into programs
  102. input.mid    get notes sorted by start time from this midi file
  103. output.txt    write output into a text file (default: standard output)
  104.  
  105. The parts in brackets [...] are optional.
  106.  
  107. Without specifying output.txt the text output is normally written to screen 
  108. but can be relinked to a file  (> filename.txt)  or a printer (> prn). 
  109. See your MS-DOS/UNIX manual for usage of  > and >> operators.
  110.  
  111. If midi file contains errors or not enough memory is available 
  112. the output will be aborted. The memory requirements depend on the number of 
  113. notes started while the note with longest duration is played. In this case
  114. the note length can only be computed when this note is turned off and in meantime
  115. all notes are waiting in memory for printing.
  116.  
  117. The hidden option -version shows the program version.
  118.  
  119. [7] A sample of resulting text output
  120.  
  121. command> midinote sample.mid 
  122. Command    Unit    At    Track    Channel    Params
  123. Header    0    0ms    T0    C0    Ver1    480units    17tracks
  124. Tempo    0    0ms    T0    C0    155.09bpm
  125. Note    3840    3094ms    T7    C7    436units    352ms    b4    Vel103
  126. Note    3840    3094ms    T10    C10    447units    361ms    c#3    Vel97
  127. Note    3840    3094ms    T7    C7    450units    363ms    g#4    Vel120
  128. Note    3840    3094ms    T7    C7    462units    373ms    e4    Vel107
  129. Note    3840    3094ms    T10    C10    509units    411ms    c2    Vel61
  130. Note    3840    3094ms    T2    C2    940units    758ms    e2    Vel118
  131. Note    4297    3463ms    T7    C7    250units    201ms    b4    Vel107
  132. ... and more such lines
  133.  
  134. A more simplier form for programs can be produced by:
  135. command> midinote -noheader -values sample.mid 
  136. H    0    0    0    0    1    480    17
  137. T    0    0    0    0    155.09
  138. N    3840    3094    7    7    436    352    71    103
  139. N    3840    3094    10    10    447    361    49    97
  140. N    3840    3094    7    7    450    363    68    120
  141. N    3840    3094    7    7    462    373    64    107
  142. N    3840    3094    10    10    509    411    36    61
  143. N    3840    3094    2    2    940    758    40    118
  144. N    4297    3463    7    7    250    201    71    107
  145. ... and more such lines
  146.  
  147. The columns have same meaning as above (see header). The first 4 values and the 
  148. command name character are always available and are separated by a tab character (#9, '\t').
  149. The params are different for each command.
  150.  
  151. Unit:
  152. This value is start of event in midi time units 
  153. (the song starts at unit 0).
  154.  
  155. At:
  156. This value is start of note in milliseconds (the song starts at
  157. millisecond 0). Tempo changes inside midi file are already 
  158. included in time computation.
  159.  
  160. Track:
  161. Track number starts to count at 1 (Only Header is assumed Track 0). 
  162. Each note is assigned to a track and a channel. Tracks are logical 
  163. parts of a song. All tracks play parallel. Multichannel tracks have 
  164. only one track.    Single channel tracks should only contain notes 
  165. assigned to a certain channel. 
  166.  
  167. Channel:
  168. Channel number is between 1 and 16 (Some events don't refer a channel, in this
  169. case channel is 0). Most events are assigned to a channel (e.g. notes).
  170. Channel 10 is usually reserved for drums (General Midi specification).
  171. Drum notes representate certain drum instruments (see General Midi 
  172. instrument list).
  173.  
  174. A "Header" (H) command has following parameters:
  175. Version:  0=One track containing all events 
  176.       1=More tracks, each track only contains events of max. one channel
  177.       2=Each track contains a song
  178. Resolution:  number of units per beat (usually 96, 120, 192,384, 480)
  179. Trackcount: number of tracks 
  180.  
  181. A "Tempo" (T) command has following parameter:
  182. BeatsPerMinute:  number of beats per minute (usually 40bpm-240bpm, 
  183.     initially 120bpm before first tempo command)
  184.  
  185. A "Note" (N) command has following parameters:
  186. Length:  the note is played for certain number of units 
  187. Time:    the note is played for about this number of milliseconds.
  188. Note:     A note value lies between 0 and 127. 12 notes in sequence build an octave:
  189.       C, C#, D,D#,E,F,F#,G,G#,A,A#,B
  190.     Octaves are counted from -1 till 10. 
  191.     Octaves are computed by formula: (notevalue / 12)-1
  192.     Therefore note value 60 is middle C (C4). A4 is middle A with frequency 440Hz.
  193. Velocity: A note velocity (1-127) measures how hard the keyboard key corresponding 
  194.     to this note was pushed. This parameter influences volume, effects and 
  195.     other note parameters. Notes with velocity 127 are usually played very
  196.     loud and with full effects assigned to the sound of this channel.
  197.  
  198. [8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
  199.  
  200.          WWW:    http://hgiicm.tu-graz.ac.at/Cpub
  201.           contains all my dos/unix midi programs
  202.          EMAIL:  gnagler@ihm.tu-graz.ac.at
  203.  
  204. [9] CHANGES
  205.  
  206. v1.0 to v2.0:
  207.   * Warning: format of output has totally changed
  208.   * Now the program also can output other events than notes (currently
  209.     header, tempo, tact measures)
  210.